<template>
  <div>
    <div id="page">
      <!-- 头部 -->
      <header>
        <h2>我的</h2>
        <p class="top">
          <span class="iconfont">&#xf0112;</span>
          <span class="iconfont" @click="goOut">&#xe71e;</span>
          <i></i>
        </p>
      </header>
      <p class="name"><i class="head"><img :src="$pre+userInfo.avatarurl" alt=""></i><span>{{userInfo.nickname}}<em>完善资料让小U更懂你</em></span><a href="#">每日签到</a></p>
      <div id="order">
        <p>
          <span><em>12</em>我的收藏</span>
          <span><em>12</em>浏览记录</span>
          <span><em>￥0</em>我的红包</span>
          <span><em>12</em>优惠券</span>
        </p>
        <div class="nav">
          <div class="top">
            <h2>我的订单</h2>
            <a href="#" @click.prevent="goMyOrder">全部订单</a>
          </div>
          <ul>
            <li>
              <img src="../../assets/images/mine_03.jpg" alt="">
              <span>待付款</span>
            </li>
            <li>
              <img src="../../assets/images/mine_05.jpg" alt="">
              <span>待收货</span>
            </li>
            <li>
              <img src="../../assets/images/mine_07.jpg" alt="">
              <span>评价</span>
            </li>
            <li>
              <img src="../../assets/images/mine_09.jpg" alt="">
              <span>售后/退款</span>
            </li>
          </ul>
        </div>
      </div>
      <!--中间 -->
      <ul id="conter">
        <li>
          <p @click="goAddress"><i class="iconfont">&#xe613;</i><span>地址管理</span></p><em class="iconfont">&#xe601;</em>
        </li>
        <li>
          <p><i class="iconfont">&#xe606;</i><span>我的钱包</span></p><em class="iconfont">剩余200U币 &#xe601;</em>
        </li>
        <li>
          <p><i class="iconfont">&#xe646;</i><span>我的二维码</span></p><em class="iconfont">&#xe601;</em>
        </li>
        <li>
          <p><i class="iconfont">&#xe61d;</i><span>我的小伙伴</span></p><em class="iconfont">&#xe601;</em>
        </li>
        <li>
          <p><i class="iconfont">&#xe653;</i><span>0元试用</span></p><em class="iconfont">&#xe601;</em>
        </li>
      </ul>
    </div>
  </div>
</template>

<script>
  import {mapGetters} from "vuex"
import { Toast } from 'vant';

  export default {
    data(){
      return{
        userInfo:sessionStorage.getItem("token")?JSON.parse(sessionStorage.getItem("token")):{},
      }
    },
    computed:{
      ...mapGetters({
        
      })
    },
    methods:{
      goAddress(){
        this.$router.push("/address")
      },
      goMyOrder(){
        this.$router.push("/mineOrder")
      },
      goOut(){
        sessionStorage.removeItem("token");
        sessionStorage.removeItem("goods");
        Toast("退出成功")
        this.$router.push("/login");
      }
    },
    mounted(){

    }
  }
</script>

<style scoped>
.head img{
      width: 1.28rem;
    height: 1.28rem;
    border-radius: 50%;
}
html,
body,
#page {
  height: 100%;
}
#page {
  max-width: 7.5rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}
header {
  height: 0.8rem;
  background: #ff6040;
  display: flex;
  color: #ffdfd8;
  padding: 0.3rem 0.12rem 0.12rem 0.33rem;
  align-items: center;
}
header h2 {
  font-size: 0.3rem;
  margin: 0 1.4rem 0 3.2rem;
}
header p {
  width: 1.72rem;
  height: 0.62rem;
  border: 1px solid #ff876c;
  border-radius: 0.31rem;
  line-height: 0.62rem;
  display: flex;
  justify-content: space-between;
  position: relative;
}
header p span {
  width: 0.86rem;
  text-align: center;
}
header p i {
  width: 1px;
  height: 0.37rem;
  background: #ff876c;
  position: absolute;
  left: 0.86rem;
  top: 0.12rem;
}
.name {
  display: flex;
  height: 1.4rem;
  background: linear-gradient(#ff6040, #ff6d54);
  padding-left: 0.2rem;
  align-items: center;
}
.name i {
  width: 1.28rem;
  height: 1.28rem;
  border-radius: 50%;
  background: #fff;
  margin-right: 0.2rem;
}
.name span {
  display: flex;
  flex-direction: column;
  color: #fff;
  font-size: 0.32rem;
  font-weight: bold;
  margin-right: 1.42rem;
}
.name span em {
  width: 2.8rem;
  height: 0.3rem;
  border: 0.02rem solid #ffb4a7;
  color: #fff;
  line-height: 0.3rem;
  text-align: center;
  font-size: 0.18rem;
  font-weight: normal;
  margin-top: 0.1rem;
}
.name a {
  width: 1.55rem;
  height: 0.4rem;
  background: #ffd5cc;
  border: 1px solid #fff;
  border-radius: 0.3rem 0 0 0.3rem;
  color: #ff6546;
  padding-left: 0.2rem;
  box-sizing: border-box;
  font-size: 0.18rem;
}
#order {
  height: 2.7rem;
  background: linear-gradient(#ff6d54, #ff8476);
  margin-bottom: 0.92rem;
}
#order p {
  display: flex;
  padding: 0 0.75rem 0 0.67rem;
  justify-content: space-between;
  padding-top: 0.26rem;
  box-sizing: border-box;
}
#order p span {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.18rem;
  color: #fff;
}
#order p span em {
  font-weight: bold;
  font-size: 0.26rem;
  color: #fff;
}
#order .nav {
  width: 94%;
  height: 2.06rem;
  margin: 0 auto;
  background: #fff;
  border-radius: 0.05rem;
  margin-top: 0.3rem;
}
#order .nav .top {
  display: flex;
  justify-content: space-between;
}
#order .nav .top h2 {
  font-size: 0.3rem;
  color: #333333;
  font-weight: bold;
  padding: 0.22rem 0 0 0.22rem;
}
#order .nav .top a {
  font-size: 0.22rem;
  color: #ff6040;
  padding: 0.3rem 0.19rem 0 0;
  box-sizing: border-box;
}
#order .nav ul {
  margin-top: 0.2rem;
  display: flex;
  padding: 0 0.4rem 0 0.56rem;
  box-sizing: border-box;
  justify-content: space-between;
}
#order .nav ul li {
  display: flex;
  flex-direction: column;
  align-items: center;
}
#order .nav ul li img {
  width: 0.6rem;
  margin-bottom: 0.1rem;
}
#conter {
  height: 4rem;
  background: #fff;
  padding: 0.4rem 0.2rem;
  box-sizing: border-box;
  margin-bottom: 1.6rem;
}
#conter li {
  height: 0.64rem;
  display: flex;
  justify-content: space-between;
  line-height: 0.64rem;
}
#conter li i {
  color: #ff6040;
  font-size: 0.32rem;
}
#conter li span {
  font-size: 0.22rem;
  color: #333333;
  font-weight: bold;
  margin-left: 0.12rem;
}
#conter li em {
  color: #666666;
  font-size: 0.18rem;
}
footer {
  display: flex;
  height: 1.66rem;
  background: #fff;
  border-top: 1px solid #cccccc;
  padding: 0 0.72rem;
  box-sizing: border-box;
  justify-content: space-between;
}
footer p {
  color: #999999;
  height: 1.66rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
footer p .iconfont {
  font-size: 0.4rem;
}
footer p span {
  font-size: 0.18rem;
}
footer .cur {
  color: #ff6040;
}
</style>